<div class="<?php echo $pluralVar;?> form">
<?php echo "<?php echo \$this->Form->create('{$modelClass}');?>\n";?>
	<fieldset>
	<?
		if(Inflector::humanize($action) === 'Add') $accionEspañol = 'Agregar';
		if(Inflector::humanize($action) === 'Edit') $accionEspañol = 'Editar';
	?>
 		<legend><?php printf("<?php __('%s %s'); ?>", $accionEspañol , $singularHumanName); ?></legend>
<?php
		echo "\t<?php\n";
		foreach ($fields as $field) {
			if (strpos($action, 'add') !== false && $field == $primaryKey) {
				continue;
			} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
				echo "\t\techo \$this->Form->input('{$field}');\n";
			}
		}
		if (!empty($associations['hasAndBelongsToMany'])) {
			foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
				echo "\t\techo \$this->Form->input('{$assocName}');\n";
			}
		}
		echo "\t?>\n";
?>
	</fieldset>

	<?php
	if (strpos($action, 'add') === false):
	echo "<?php echo \$this->Form->submit(__('Editar', true), array('div'=>false, 'name'=>'submit'));?>\n";
	endif;
	if (strpos($action, 'edit') === false):
	echo "<?php echo \$this->Form->submit(__('Agregar', true), array('div'=>false, 'name'=>'submit'));?>\n";
	endif;
  	echo "<?php echo \$this->Form->submit('Cancelar', array('div'=>false, 'name'=>'cancelar')); ?>\n";
  	echo "<?php echo \$this->Form->end();?>\n";
	?>

<br>
</div>
<div class="actions">
	<h3><?php echo "<?php __('Acciones'); ?>"; ?></h3>
	<ul>

<?php if (strpos($action, 'add') === false): ?>
		<li><?php echo "<?php echo \$this->Html->link(__('Borrar', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Esta seguro de borrar a %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
<?php endif;?>
		<li><?php echo "<?php echo \$this->Html->link(__('Lista de " . $pluralHumanName . "', true), array('action' => 'index'));?>";?></li>
<?php
		$done = array();
		foreach ($associations as $type => $data) {
			foreach ($data as $alias => $details) {
				if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
					echo "\t\t<li><?php echo \$this->Html->link(__('Lista de " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
					echo "\t\t<li><?php echo \$this->Html->link(__('Agregar " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
					$done[] = $details['controller'];
				}
			}
		}
?>
	</ul>
</div>